package com.zy.dao;

import com.zy.dataobject.ItemStock;
import com.zy.dataobject.ItemStockExample;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface ItemStockMapper {

    int countByExample(ItemStockExample example);


    int deleteByExample(ItemStockExample example);


    int deleteByPrimaryKey(Integer id);


    int insert(ItemStock record);


    int insertSelective(ItemStock record);


    List<ItemStock> selectByExample(ItemStockExample example);

    ItemStock selectByPrimaryKey(Integer id);

    ItemStock selectByItemId(Integer itemId );



    int updateByExampleSelective(@Param("record") ItemStock record, @Param("example") ItemStockExample example);


    int updateByExample(@Param("record") ItemStock record, @Param("example") ItemStockExample example);


    int updateByPrimaryKeySelective(ItemStock record);
    int updateByItemIdSelective(ItemStock record);


    int updateByPrimaryKey(ItemStock record);

    // 减少库存 返回操作影响条数
    int decreseStock(Integer itemId,Integer amount);
}